<?php 
$sql="SELECT * FROM friends INNER JOIN users ON friends.friend_id=users.id WHERE user_id=".$_COOKIE["user_id"]."and friend_id=".$_GET["id"];
$result=mysql_query($sql);
$rows=mysql_num_rows($result);
$i=2;
if($rows)
{
	//friend
	$i=1;
}
else
{
	//not friend
	$i=0;
}
$row=mysql_fetch_array($result);
$fullname=$row["firstname"].$row["lastname"];
?>